package com.yanlight.app.request;

import java.util.SortedMap;
import java.util.TreeMap;

/**
 * https://pay.weixin.qq.com/wiki/doc/api/native_sl.php?chapter=9_4
 */
public class WxDrawbackRequest {

    private String appid;

    private String mch_id;

    //非必要
//    private String sub_appid;

    private String sub_mch_id;

    private String nonce_str;

    private String sign;

    private String transaction_id;

    private String out_trade_no;

    private String out_refund_no;

    private int total_fee;

    private int refund_fee;

    private String refund_fee_type = "CNY";

    private String refund_desc;

//    private String refund_account;

    private String notify_url;

    public SortedMap<String, String> setupParams() {
        SortedMap<String, String> paramsMap = new TreeMap<>();
        paramsMap.put("appid", getAppid());
        paramsMap.put("mch_id", getMch_id());
        paramsMap.put("sub_mch_id", getSub_mch_id());
        paramsMap.put("nonce_str", getNonce_str());
        paramsMap.put("transaction_id", getTransaction_id());
        paramsMap.put("out_trade_no", getOut_trade_no());
        paramsMap.put("out_refund_no", getOut_refund_no());
        paramsMap.put("total_fee", getTotal_fee() + "");
        paramsMap.put("refund_fee", getRefund_fee() + "");
        paramsMap.put("refund_fee_type", getRefund_fee_type());
        paramsMap.put("refund_desc", getRefund_desc());
        paramsMap.put("notify_url", getNotify_url());
        return paramsMap;
    }

    public String getAppid() {
        return appid;
    }

    public void setAppid(String appid) {
        this.appid = appid;
    }

    public String getMch_id() {
        return mch_id;
    }

    public void setMch_id(String mch_id) {
        this.mch_id = mch_id;
    }

//    public String getSub_appid() {
//        return sub_appid;
//    }
//
//    public void setSub_appid(String sub_appid) {
//        this.sub_appid = sub_appid;
//    }

    public String getSub_mch_id() {
        return sub_mch_id;
    }

    public void setSub_mch_id(String sub_mch_id) {
        this.sub_mch_id = sub_mch_id;
    }

    public String getNonce_str() {
        return nonce_str;
    }

    public void setNonce_str(String nonce_str) {
        this.nonce_str = nonce_str;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    public String getTransaction_id() {
        return transaction_id;
    }

    public void setTransaction_id(String transaction_id) {
        this.transaction_id = transaction_id;
    }

    public String getOut_trade_no() {
        return out_trade_no;
    }

    public void setOut_trade_no(String out_trade_no) {
        this.out_trade_no = out_trade_no;
    }

    public String getOut_refund_no() {
        return out_refund_no;
    }

    public void setOut_refund_no(String out_refund_no) {
        this.out_refund_no = out_refund_no;
    }

    public int getTotal_fee() {
        return total_fee;
    }

    public void setTotal_fee(int total_fee) {
        this.total_fee = total_fee;
    }

    public int getRefund_fee() {
        return refund_fee;
    }

    public void setRefund_fee(int refund_fee) {
        this.refund_fee = refund_fee;
    }

    public String getRefund_fee_type() {
        return refund_fee_type;
    }

    public void setRefund_fee_type(String refund_fee_type) {
        this.refund_fee_type = refund_fee_type;
    }

    public String getRefund_desc() {
        return refund_desc;
    }

    public void setRefund_desc(String refund_desc) {
        this.refund_desc = refund_desc;
    }

//    public String getRefund_account() {
//        return refund_account;
//    }
//
//    public void setRefund_account(String refund_account) {
//        this.refund_account = refund_account;
//    }

    public String getNotify_url() {
        return notify_url;
    }

    public void setNotify_url(String notify_url) {
        this.notify_url = notify_url;
    }
}
